import { _homeData } from "../../service/api";

Page({
  data: {
    newGoodsList: [],
    hotGoodsList: [],
    topicList: [],
    brandList: [],
    floorGoods: [],
    banner: [],
    channel: [],
  },
  onLoad: function (options) {
    this.initData();
  },
  initData() {
    wx.showLoading({ title: "加载中..." });
    _homeData().then((res) => {
      this.setData({
        newGoodsList: res.newGoodsList,
        hotGoodsList: res.hotGoodsList,
        topicList: res.topicList,
        brandList: res.brandList,
        floorGoods: res.categoryList,
        banner: res.banner,
        channel: res.channel,
      });
    });
    wx.hideLoading();
  },
});
